package com.lykj.modules.shop.wrapper;

import com.lykj.core.mp.support.BaseEntityWrapper;
import com.lykj.core.tool.utils.BeanUtil;
import com.lykj.modules.shop.entity.UserBill;
import com.lykj.modules.shop.vo.UserBillVO;

import java.util.Objects;

/**
 * 用户账单表包装类,返回视图层所需的字段
 *
 * @author cxl
 * @since 2022-01-14
 */
public class UserBillWrapper extends BaseEntityWrapper<UserBill, UserBillVO> {

	public static UserBillWrapper build() {
		return new UserBillWrapper();
	}

	@Override
	public UserBillVO entityVO(UserBill userBill) {
		UserBillVO userBillVO = Objects.requireNonNull(BeanUtil.copy(userBill, UserBillVO.class));

		//User createUser = UserCache.getUser(userBill.getCreateUser());
		//User updateUser = UserCache.getUser(userBill.getUpdateUser());
		//userBillVO.setCreateUserName(createUser.getName());
		//userBillVO.setUpdateUserName(updateUser.getName());

		return userBillVO;
	}

}
